package com.yeban.issue.arraylist;

import java.util.ArrayList;

/**
 * @Desc TODO
 * @Author yeban
 * @Date 2025/10/18
 *
 * contains方法使用
 */
public class ContainsDemo {

    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("A");
        list.add("B");
        list.add("C");

        boolean containsA = list.contains("A");
        boolean containsD = list.contains("D");
        System.out.println("containsA = " + containsA);
        System.out.println("containsD = " + containsD);
    }
}
